/**
 *	数据库提醒表-todo
 *	开发者：雨中磐石
 *	地址：www.rockoa.com
 *	日期：2023-07-19
 */

package com.framework.Module.base.todo;

import com.framework.ACore.ModuleWhere;
import com.framework.Flow.FlowWhere;
import com.framework.Table.Table;
import com.framerock.baselib.Rock;

public class Tabletodo extends  Table{
  

    protected void initTable() {
        this.tablename   = "todo";
        this.tablenamesm = "消息提醒";

        this.flowsetMap  = Rock.getMap(new String[]{
                "type", "基础",
                "sort", "0",
                "isxt", "2",
                "sortdir","optdt desc",
                "summary", "[{title}]{mess}",
                "imgurl","https://cloudplat-1251238447.cos.ap-nanjing.myqcloud.com/rockfile/upload/2024-08/19_17191761_s.png",
                "istj","1"
        });

        this.addfields("title", "varchar(50)", "", "标题", new String[]{
                "isss","1",
        });
        this.addfields("mess", "varchar(500)", "", "提醒内容", new String[]{
                "isss","1",
                "isbt","1",
                "isalign","1",
                "fieldstype","textarea",
        });
        this.addfields("optdt", "datetime", null, "时间", new String[]{
                "ispx","1",
                "islb","1",
                "islu","0"
        });
        this.addfields("mknum", "varchar(50)", "", "对应模块", new String[]{
                "islb","0",
                "islu","0"
        });
        this.addfields("mid", "int(11)", "0", "单据Id", new String[]{
                "islb","0",
                "islu","0"
        });
        this.addfields("status", "tinyint(1)", "0", "已读@0|未读|red,1|已读|gray@标已读了", new String[]{
                "fieldstype","checkbox",
                "iseditlx","1",
                "ispx","1"
        });
        this.addfields("funitid", "int(11)", "0", "单位应用", new String[]{
                "islb","0",
                "islu","0",
                "iszs","0"
        });
        this.addfields("cid", "int(11)", "0", "对应单位", new String[]{
                "islb","0",
                "islu","0",
                "iszs","0"
        });
        this.addfields("aid", "int(11)", "0", "对应人员", new String[]{
                "islb","0",
                "islu","0"
        });



        this.addfields("cid", "KEY", "`cid`", "单位ID");
        this.addfields("aid", "KEY", "`aid`", "人员ID");

        //添加一些条件
        this.addWhere(ModuleWhere.get()
                .setNum("my")
                .setName("给我的提醒")
                .setWhere("`aid`={aid}")
                .setWtype(FlowWhere.WTYPE_EDIT)
        );
        this.addWhere(ModuleWhere.get()
                .setNum("mywd")
                .setName("未读提醒")
                .setWhere("`aid`={aid} AND `status`=0")
        );


        this.addFlowMenu("yidu",new String[]{
                "name","标识已读",
                "type","1",
                "where","`aid`={aid} AND `status`=0",
                "upcont", "`status`=1",
                "statuscolor","red"
        });
    }
}
